package com.bw.BaseImage.common;

import android.graphics.drawable.Drawable;

public class ImageOption {
    private Drawable mPlaceImage;
    private Drawable mErrorImage;
    private boolean mSkipMemoryCache;
    private boolean mSkipDiskCache;

    private ImageOption(Drawable placeImage, Drawable errorImage, boolean skipMemoryCache, boolean skipDiskCache)
    {
        this.mPlaceImage=placeImage;
        this.mErrorImage=errorImage;
        this.mSkipMemoryCache=skipMemoryCache;
        this.mSkipDiskCache=skipDiskCache;
    }

    public Drawable getPlaceImage() {
        return mPlaceImage;
    }

    public Drawable getErrorImage() {
        return mErrorImage;
    }

    public boolean isSkipMemoryCache() {
        return mSkipMemoryCache;
    }

    public boolean isSkipDiskCache() {
        return mSkipDiskCache;
    }

    public static class Builder {

        private Drawable placeImage;
        private Drawable errorImage;
        private boolean skipMemoryCache;
        private boolean skipDiskCache;

        public Builder setPlaceImage(Drawable placeImage) {
            this.placeImage = placeImage;
            return this;
        }

        public Builder setErrorImage(Drawable errorImage) {
            this.errorImage = errorImage;
            return this;
        }

        public Builder setSkipMemoryCache(boolean skipMemoryCache) {
            this.skipMemoryCache = skipMemoryCache;
            return this;
        }

        public Builder setSkipDiskCache(boolean skipDiskCache) {
            this.skipDiskCache = skipDiskCache;
            return this;
        }

        public ImageOption build() {
            return new ImageOption(placeImage,errorImage,skipDiskCache,skipMemoryCache);
        }
    }
}
